package com.slipper.system.flow.controller;

import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.slipper.system.flow.bo.FlowLineCondBO;
import com.slipper.system.flow.service.FlowLineCondService;
import com.slipper.util.ResultUtil;

/**
 * 流程线路条件表
 */
@RestController
@RequestMapping("/system/flowLineCond")
public class FlowLineCondController {
    @Resource
    private FlowLineCondService flowLineCondService;
    
    @PostMapping(value = "/queryBy")
    public String queryBy(@RequestBody FlowLineCondBO bo) {
        if(bo.getId() == null || "".equals(bo.getId())) {
            return ResultUtil.failureResult("数据获取失败！");
        }
        return ResultUtil.successResult(flowLineCondService.queryBy(bo.getId()));
    }
    
    @PostMapping(value = "/queryPage")
    public String queryPage(@RequestBody FlowLineCondBO bo) {
        return ResultUtil.successResult(flowLineCondService.queryPage(bo));
    }

    @PostMapping(value = "/save")
    public String save(@RequestBody FlowLineCondBO bo) {
        return ResultUtil.successResult(flowLineCondService.save(bo));
    }

    @PostMapping(value = "/delete")
    public String delete(@RequestBody FlowLineCondBO bo) {
        return ResultUtil.successResult(flowLineCondService.delete(bo));
    }
}
